import request from '@/utils/request';
import { other } from './prefix';

const aboutWorksManage = {
  // 查询banner列表
  getAboutWorks(params) {
    return request.get(other + '/about_works', { params });
  },
  // 创建banner
  setAboutWorks(params) {
    return request.post(other + '/about_works', params);
  },
  // 更新banner
  updAboutWorks(id, params) {
    return request.post(other + '/about_works/' + id, params);
  },
  // 删除banner
  delAboutWorks(id) {
    return request.delete(other + '/about_works/' + id);
  },
  // 上传banner图片
  setAboutWorksImage(id, params) {
    return request.post(other + '/about_works/' + id + '?op=upload_file&name=title_page', params);
  },
  setAboutWorksVideo(id, params) {
    return request.post(other + '/about_works/' + id + '?op=upload_file&name=video_url', params);
  },
};

export default aboutWorksManage;
